<?php /* Smarty version 2.6.20, created on 2011-12-03 16:42:36
         compiled from C:%5CD%5CMarocMall/themes/prestashop/./product-sort.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', 'C:\\D\\MarocMall/themes/prestashop/./product-sort.tpl', 55, false),array('function', 'l', 'C:\\D\\MarocMall/themes/prestashop/./product-sort.tpl', 58, false),)), $this); ?>

<?php if (isset ( $this->_tpl_vars['orderby'] ) && isset ( $this->_tpl_vars['orderway'] )): ?>
<!-- Sort products -->
<?php if (isset ( $_GET['id_category'] ) && $_GET['id_category']): ?>
	<?php $this->assign('request', $this->_tpl_vars['link']->getPaginationLink('category',$this->_tpl_vars['category'],false,true)); ?>
<?php elseif (isset ( $_GET['id_manufacturer'] ) && $_GET['id_manufacturer']): ?>
	<?php $this->assign('request', $this->_tpl_vars['link']->getPaginationLink('manufacturer',$this->_tpl_vars['manufacturer'],false,true)); ?>
<?php elseif (isset ( $_GET['id_supplier'] ) && $_GET['id_supplier']): ?>
	<?php $this->assign('request', $this->_tpl_vars['link']->getPaginationLink('supplier',$this->_tpl_vars['supplier'],false,true)); ?>
<?php else: ?>
	<?php $this->assign('request', $this->_tpl_vars['link']->getPaginationLink(false,false,false,true)); ?>
<?php endif; ?>

<script type="text/javascript">
//<![CDATA[
<?php echo '
$(document).ready(function()
{
	$(\'#selectPrductSort\').change(function()
	{
		var requestSortProducts = \''; ?>
<?php echo $this->_tpl_vars['request']; ?>
<?php echo '\';
		var splitData = $(this).val().split(\':\');
		document.location.href = requestSortProducts + ((requestSortProducts.indexOf(\'?\') < 0) ? \'?\' : \'&\') + \'orderby=\' + splitData[0] + \'&orderway=\' + splitData[1];
	});
});
//]]>
'; ?>

</script>

<form id="productsSortForm" action="<?php echo ((is_array($_tmp=$this->_tpl_vars['request'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'htmlall', 'UTF-8') : smarty_modifier_escape($_tmp, 'htmlall', 'UTF-8')); ?>
">
	<p class="select">
		<select id="selectPrductSort">
			<option value="<?php echo ((is_array($_tmp=$this->_tpl_vars['orderbydefault'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'htmlall', 'UTF-8') : smarty_modifier_escape($_tmp, 'htmlall', 'UTF-8')); ?>
:<?php echo ((is_array($_tmp=$this->_tpl_vars['orderwaydefault'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'htmlall', 'UTF-8') : smarty_modifier_escape($_tmp, 'htmlall', 'UTF-8')); ?>
" <?php if ($this->_tpl_vars['orderby'] == $this->_tpl_vars['orderbydefault']): ?>selected="selected"<?php endif; ?>><?php echo smartyTranslate(array('s' => '--'), $this);?>
</option>
			<?php if (! $this->_tpl_vars['PS_CATALOG_MODE']): ?>
				<option value="price:asc" <?php if ($this->_tpl_vars['orderby'] == 'price' && $this->_tpl_vars['orderway'] == 'asc'): ?>selected="selected"<?php endif; ?>><?php echo smartyTranslate(array('s' => 'Price: lowest first'), $this);?>
</option>
				<option value="price:desc" <?php if ($this->_tpl_vars['orderby'] == 'price' && $this->_tpl_vars['orderway'] == 'desc'): ?>selected="selected"<?php endif; ?>><?php echo smartyTranslate(array('s' => 'Price: highest first'), $this);?>
</option>
			<?php endif; ?>
			<option value="name:asc" <?php if ($this->_tpl_vars['orderby'] == 'name' && $this->_tpl_vars['orderway'] == 'asc'): ?>selected="selected"<?php endif; ?>><?php echo smartyTranslate(array('s' => 'Product Name: A to Z'), $this);?>
</option>
			<option value="name:desc" <?php if ($this->_tpl_vars['orderby'] == 'name' && $this->_tpl_vars['orderway'] == 'desc'): ?>selected="selected"<?php endif; ?>><?php echo smartyTranslate(array('s' => 'Product Name: Z to A'), $this);?>
</option>
			<?php if (! $this->_tpl_vars['PS_CATALOG_MODE']): ?>
				<option value="quantity:desc" <?php if ($this->_tpl_vars['orderby'] == 'quantity' && $this->_tpl_vars['orderway'] == 'desc'): ?>selected="selected"<?php endif; ?>><?php echo smartyTranslate(array('s' => 'In-stock first'), $this);?>
</option>
			<?php endif; ?>
		</select>
		<label for="selectPrductSort"><?php echo smartyTranslate(array('s' => 'Sort by'), $this);?>
</label>
	</p>
</form>
<!-- /Sort products -->
<?php endif; ?>